﻿// ---------------------------------
// SmarterSql (c) Johan Sassner 2008
// ---------------------------------
namespace Sassner.SmarterSql.Parsing {
	public enum TokenKind {
		Unknown = -10,
		EndOfFile,
		EmptyId,
		NoneId,
		NewLine,
		Error,

		SingleLineComment = 0,
		MultiLineComment,
		Name,
		Variable,
		SystemVariable,
		ValueString,
		ValueNumber,
		TemporaryObject,

		Add,
		AddEqual,
		Assign,
		BackQuote,
		BitwiseAnd,
		BitwiseAndEqual,
		BitwiseOr,
		BitwiseOrEqual,
		Colon,
		Comma,
		DivEqual,
		Divide,
		Dot,
		FloorDivide,
		GreaterThan,
		GreaterThanOrEqual,
		LeftBrace,
		LeftBracket,
		LeftParenthesis,
		LeftShift,
		LessThan,
		LessThanGreaterThan,
		LessThanOrEqual,
		Mod,
		ModEqual,
		Multiply,
		MultiplyEqual,
		NotEqual,
		NotEqualTo,
		NotLessThan,
		NotGreaterThan,
		Power,
		RightBrace,
		RightBracket,
		RightParenthesis,
		RightShift,
		Semicolon,
		Subtract,
		SubtractEqual,
		Twiddle,
		Xor,
		XorEqual,

		// Sql Keywords
		KeywordSelect,
		KeywordFrom,
		KeywordPivot,
		KeywordUnpivot,
		KeywordUpdate,
		KeywordDelete,

		KeywordInsert,
		KeywordInto,
		KeywordValues,
		KeywordDefault,
		KeywordPrint,
		KeywordCurrent,
		KeywordWhere,
		KeywordJoin,
		KeywordInner,
		KeywordOuter,
		KeywordOn,
		KeywordAs,
		KeywordTo,
		KeywordAnd,
		KeywordOr,
		KeywordDeclare,
		KeywordGo,
		KeywordCase,
		KeywordWhen,
		KeywordElse,
		KeywordThen,
		KeywordEnd,
		KeywordBegin,
		KeywordIf,
		KeywordExec,
		KeywordNoOutput,
		KeywordUse,
		KeywordIn,
		KeywordAt,
		KeywordLogin,
		KeywordUser,

		// ORDER BY
		KeywordOrder,
		KeywordCollate,
		KeywordAsc,
		KeywordDesc,
		// GROUP BY
		KeywordGroup,
		KeywordBy,
		KeywordCube,
		KeywordRollup,

		KeywordHaving,
		KeywordNot,
		KeywordIs,
		KeywordNull,
		KeywordGrant,
		KeywordDeny,
		KeywordRevoke,
		KeywordAll,
		KeywordDistinct,
		KeywordTop,
		KeywordPercent,
		KeywordTies,
		KeywordExists,

		KeywordSome,
		KeywordAny,

		// Join
		KeywordFull,
		KeywordLoop,
		KeywordHash,
		KeywordMerge,
		KeywordCross,

		KeywordRemote,
		KeywordAlter,
		KeywordControl,
		KeywordReceive,
		KeywordTakeOwnership,
		KeywordViewDefinition,
		KeywordCursor,
		KeywordUnion,

		KeywordBigint,
		KeywordDecimal,
		KeywordInt,
		KeywordNumeric,
		KeywordSmallint,
		KeywordMoney,
		KeywordTinyint,
		KeywordSmallmoney,
		KeywordBit,
		KeywordFloat,
		KeywordReal,
		KeywordDatetime,
		KeywordSmalldatetime,
		KeywordChar,
		KeywordText,
		KeywordVarchar,
		KeywordnChar,
		KeywordnText,
		KeywordNvarchar,
		KeywordBinary,
		KeywordImage,
		KeywordVarbinary,
		KeywordTimestamp,
		KeywordSql_variant,
		KeywordTable,
		KeywordUniqueidentifier,
		KeywordXml,
		KeywordSysName,

		KeywordAtAtConnections,
		KeywordAtAtCpu_Busy,
		KeywordAtAtCursor_rows,
		KeywordAtAtDatefirst,
		KeywordAtAtDbts,
		KeywordAtAtError,
		KeywordAtAtFetch_status,
		KeywordAtAtIdentity,
		KeywordAtAtIdle,
		KeywordAtAtIo_Busy,
		KeywordAtAtLangid,
		KeywordAtAtLanguage,
		KeywordAtAtLock_Timeout,
		KeywordAtAtMax_Connections,
		KeywordAtAtMax_Precision,
		KeywordAtAtNestlevel,
		KeywordAtAtOptions,
		KeywordAtAtPack_Received,
		KeywordAtAtPack_Sent,
		KeywordAtAtPacket_Errors,
		KeywordAtAtRemserver,
		KeywordAtAtRowcount,
		KeywordAtAtServername,
		KeywordAtAtServicename,
		KeywordAtAtSpid,
		KeywordAtAtTextsize,
		KeywordAtAtTimeticks,
		KeywordAtAtTotal_Errors,
		KeywordAtAtTotal_Read,
		KeywordAtAtTotal_Write,
		KeywordAtAtTrancount,
		KeywordAtAtVersion,

		KeywordLike,
		KeywordContains,
		KeywordFreeText,
		KeywordEscape,
		KeywordBetween,
		KeywordWith,
		KeywordRound,

		// Tabel hints
		KeywordNoExpand,
		KeywordIndex,
		KeywordFastFirstRow,
		KeywordHoldLock,
		KeywordNoLock,
		KeywordNoWait,
		KeywordPagLock,
		KeywordReadCommitted,
		KeywordReadCommittedLock,
		KeywordReadPast,
		KeywordReadUncommitted,
		KeywordRepeatableRead,
		KeywordRowLock,
		KeywordSerializable,
		KeywordTabLock,
		KeywordTabLockX,
		KeywordUpdLock,
		KeywordXLock,
		KeywordKeepIdentity,
		KeywordKeepDefaults,
		KeywordIgnore_Constraints,
		KeywordIgnore_Triggers,
		KeywordWhile,
		KeywordBreak,
		KeywordContinue,
		KeywordGoto,
		KeywordReturn,
		KeywordWaitFor,
		KeywordDelay,
		KeywordTime,
		KeywordTimeout,
		KeywordTry,
		KeywordCatch,
		KeywordIdentity,
		KeywordCreate,
		KeywordDrop,
		KeywordPad_index,
		KeywordStatistics_norecompute,
		KeywordAllow_row_locks,
		KeywordAllow_page_locks,
		KeywordIgnore_dup_key,
		KeywordTextimage_on,
		KeywordRowguidcol,
		KeywordContent,
		KeywordDocument,
		KeywordConstraint,
		KeywordPrimary,
		KeywordKey,
		KeywordUnique,
		KeywordClustered,
		KeywordNonclustered,
		KeywordPersisted,
		KeywordFillfactor,
		KeywordForeign,
		KeywordReferences,
		KeywordAction,
		KeywordNo,
		KeywordCascade,
		KeywordCheck,

		// Rowset functions
		KeywordOpenXml,
		KeywordContainsTable,
		KeywordOpenQuery,
		KeywordFreeTextTable,
		KeywordOpenRowset,
		KeywordBulk,
		KeywordFormatFile,
		KeywordSingleBlob,
		KeywordSingleClob,
		KeywordSingleNClob,
		KeywordCodePage,
		KeywordErrorFile,
		KeywordFirstRow,
		KeywordLastRow,
		KeywordMaxErrors,
		KeywordRowsPerBatch,
		KeywordOpenDataSource,

		// String functions
		KeywordLeft,
		KeywordRight,
		KeywordAscii,
		KeywordSoundex,
		KeywordPatindex,
		KeywordSpace,
		KeywordCharindex,
		KeywordQuotename,
		KeywordStr,
		KeywordDifference,
		KeywordReplace,
		KeywordStuff,
		KeywordReplicate,
		KeywordSubstring,
		KeywordLen,
		KeywordReverse,
		KeywordUnicode,
		KeywordLower,
		KeywordUpper,
		KeywordLtrim,
		KeywordRtrim,

		// Date functions
		KeywordDateAdd,
		KeywordDateDiff,
		KeywordDatePart,
		KeywordDateName,
		KeywordDay,
		KeywordGetDate,
		KeywordGetUTCDate,
		KeywordMonth,
		KeywordYear,
		KeywordQuarter,
		KeywordDayOfYear,
		KeywordWeek,
		KeywordWeekDay,
		KeywordHour,
		KeywordMinute,
		KeywordSecond,
		KeywordMilliSecond,

		// Aggregate functions
		KeywordCount,
		KeywordAvg,
		KeywordMin,
		KeywordChecksum_Agg,
		KeywordSum,
		KeywordStdev,
		KeywordCount_Big,
		KeywordStdevp,
		KeywordGrouping,
		KeywordVar,
		KeywordMax,
		KeywordVarp,

		// TableSample
		KeywordTableSample,
		KeywordSystem,
		KeywordRows,
		KeywordRepeatable,

		// System functions
		KeywordApp_Name,
		KeywordCast,
		KeywordConvert,
		KeywordCoalesce,
		KeywordCollationproperty,
		KeywordColumns_Updated,
		KeywordCurrent_Timestamp,
		KeywordCurrent_User,
		KeywordDatalength,
		KeywordError_Line,
		KeywordError_Message,
		KeywordError_Number,
		KeywordError_Procedure,
		KeywordError_Severity,
		KeywordError_State,
		KeywordFn_Helpcollations,
		KeywordFn_Servershareddrives,
		KeywordFn_Virtualfilestats,
		KeywordFormatmessage,
		KeywordGetansinull,
		KeywordHost_Id,
		KeywordHost_Name,
		KeywordIdent_Current,
		KeywordIdent_Incr,
		KeywordIdent_Seed,
		KeywordIsdate,
		KeywordIsnull,
		KeywordIsnumeric,
		KeywordNewid,
		KeywordNullif,
		KeywordParsename,
		KeywordOriginal_Login,
		KeywordRowcount_Big,
		KeywordScope_Identity,
		KeywordServerproperty,
		KeywordSessionproperty,
		KeywordSession_User,
		KeywordStats_Date,
		KeywordSystem_User,
		KeywordUser_Name,
		KeywordXact_State,

		// Object_* functions
		KeywordObjectId,
		KeywordObjectName,
		KeywordObjectSchemaName,

		// Mathematical functions
		KeywordAbs,
		KeywordDegrees,
		KeywordRand,
		KeywordAcos,
		KeywordExp,
		KeywordAsin,
		KeywordFloor,
		KeywordSign,
		KeywordAtan,
		KeywordLog,
		KeywordSin,
		KeywordAtn2,
		KeywordLog10,
		KeywordSqrt,
		KeywordCeiling,
		KeywordPi,
		KeywordSquare,
		KeywordCos,
		KeywordPower,
		KeywordTan,
		KeywordCot,
		KeywordRadians,

		// Create procedure 
		KeywordProc,
		KeywordProcedure,
		KeywordVarying,
		KeywordOut,
		KeywordOutput,
		KeywordFor,
		KeywordReplication,
		KeywordEncryption,
		KeywordRecompile,
		KeywordCaller,
		KeywordSelf,
		KeywordOwner,
		KeywordExternal,
		KeywordName,

		// Cursor
		KeywordInsensitive,
		KeywordScroll,
		KeywordRead,
		KeywordOnly,
		KeywordOf,
		KeywordLocal,
		KeywordGlobal,
		KeywordForwardOnly,
		KeywordStatic,
		KeywordKeyset,
		KeywordDynamic,
		KeywordFastForward,
		KeywordReadOnly,
		KeywordScrollLocks,
		KeywordOptimistic,
		KeywordTypeWarning,
		KeywordCursorStatus,
		KeywordDeallocate,
		KeywordFetch,
		KeywordNext,
		KeywordPrior,
		KeywordFirst,
		KeywordLast,
		KeywordAbsolute,
		KeywordRelative,
		KeywordOpen,
		KeywordClose,

		// SET xxx
		KeywordSet,
		KeywordNoCount,
		KeywordDatefirst,
		KeywordDateformat,
		KeywordDeadlock_Priority,
		KeywordLock_Timeout,
		KeywordConcat_Null_Yields_Null,
		KeywordCursor_Close_On_Commit,
		KeywordFips_Flagger,
		KeywordIdentity_Insert,
		KeywordLanguage,
		KeywordOffsets,
		KeywordQuoted_Identifier,
		KeywordArithabort,
		KeywordArithignore,
		KeywordFmtonly,
		KeywordNocount,
		KeywordNoExec,
		KeywordNumeric_Roundabort,
		KeywordParseonly,
		KeywordQuery_Governor_Cost_Limit,
		KeywordRowcount,
		KeywordTextsize,
		KeywordAnsi_Defaults,
		KeywordAnsi_Null_Dflt_Off,
		KeywordAnsi_Null_Dflt_On,
		KeywordAnsi_Nulls,
		KeywordAnsi_Padding,
		KeywordAnsi_Warnings,
		KeywordForceplan,
		KeywordShowplan_All,
		KeywordShowplan_Text,
		KeywordShowplan_Xml,
		KeywordStatistics_Io,
		KeywordStatistics_Xml,
		KeywordStatistics_Profile,
		KeywordStatistics_Time,
		KeywordImplicit_Transactions,
		KeywordRemote_Proc_Transactions,
		KeywordTransaction_Isolation_Level,
		KeywordXact_Abort,

		KeywordRaisError,
		KeywordSetError,
		KeywordOff,

		// CREATE FUNCTION
		KeywordFunction,
		KeywordReturns,
		KeywordSchemabinding,
		KeywordInput,
		KeywordCalled,

		// View
		KeywordView,
		KeywordOption,
		KeywordView_Metadata,

		// Transactions
		KeywordTransaction,
		KeywordMark,
		KeywordDistributed,
		KeywordCommit,
		KeywordWork,
		KeywordRollback,
		KeywordSave,

		KeywordExplicit,
		KeywordKill,
		KeywordStatusOnly,

		// OVER_CLAUSE
		KeywordOver,
		KeywordPartition,

		// Ranking functions
		KeywordRank,
		KeywordDenseRank,
		KeywordNTile,
		KeywordRowNumber,

		KeywordAtAtProcid,
		KeywordFileProperty,
		KeywordAssemblyProperty,
		KeywordFn_ListExtendedProperty,
		KeywordCol_Length,
		KeywordFullTextCatalogProperty,
		KeywordCol_Name,
		KeywordFullTextServiceProperty,
		KeywordColumnProperty,
		KeywordIndex_Col,
		KeywordDatabaseProperty,
		KeywordIndexKey_Property,
		KeywordDatabasePropertyEx,
		KeywordIndexProperty,
		KeywordDb_Id,
		KeywordObject_Id,
		KeywordDb_Name,
		KeywordObject_Name,
		KeywordObject_Schema_Name,
		KeywordFile_Id,
		KeywordObjectProperty,
		KeywordFile_Idex,
		KeywordObjectPropertyEx,
		KeywordFile_Name,
		KeywordSql_Variant_Property,
		KeywordFilegroup_Id,
		KeywordType_Id,
		KeywordFilegroup_Name,
		KeywordType_Name,
		KeywordFileGroupProperty,
		KeywordTypeProperty,

		KeywordSetuser,
		KeywordSys_Fn_Builtin_Permissions,
		KeywordSuser_Id,
		KeywordHas_Perms_By_Name,
		KeywordSuser_Sid,
		KeywordIs_Member,
		KeywordSuser_Sname,
		KeywordIs_Srvrolemember,
		KeywordPermissions,
		KeywordSuser_Name,
		KeywordSchema_Id,
		KeywordUser_Id,
		KeywordSchema_Name,

		KeywordTextValid,
		KeywordTextPtr,
		KeywordLoginProperty,
		KeywordTruncate,

		// Trigger
		KeywordTrigger,
		KeywordAfter,
		KeywordInstead,
		KeywordAppend,
		KeywordServer,
		KeywordDatabase,
		KeywordEnable,
		KeywordDisable,

		// Event Groups for Use with DDL Triggers
		KeywordDDL_Application_Role_Events,
		KeywordDDL_Assembly_Events,
		KeywordDDL_Authorization_Database_Events,
		KeywordDDL_Authorization_Server_Events,
		KeywordDDL_Certificate_Events,
		KeywordDDL_Contract_Events,
		KeywordDDL_Database_Events,
		KeywordDDL_Database_Level_Events,
		KeywordDDL_Database_Security_Events,
		KeywordDDL_Endpoint_Events,
		KeywordDDL_Event_Notification_Events,
		KeywordDDL_Events,
		KeywordDDL_Function_Events,
		KeywordDDL_Gdr_Database_Events,
		KeywordDDL_Gdr_Server_Events,
		KeywordDDL_Index_Events,
		KeywordDDL_Login_Events,
		KeywordDDL_Message_Type_Events,
		KeywordDDL_Partition_Events,
		KeywordDDL_Partition_Function_Events,
		KeywordDDL_Partition_Scheme_Events,
		KeywordDDL_Procedure_Events,
		KeywordDDL_Queue_Events,
		KeywordDDL_Remote_Service_Binding_Events,
		KeywordDDL_Role_Events,
		KeywordDDL_Route_Events,
		KeywordDDL_Schema_Events,
		KeywordDDL_Server_Level_Events,
		KeywordDDL_Server_Security_Events,
		KeywordDDL_Service_Events,
		KeywordDDL_Ssb_Events,
		KeywordDDL_Synonym_Events,
		KeywordDDL_Table_View_Events,
		KeywordDDL_Trigger_Events,
		KeywordDDL_Table_Events,
		KeywordDDL_Type_Events,
		KeywordDDL_User_Events,
		KeywordDDL_Xml_Schema_Collection_Events,

		// DDL Statements with Database Scope
		KeywordCreate_Application_Role,
		KeywordAlter_Application_Role,
		KeywordDrop_Application_Role,
		KeywordCreate_Assembly,
		KeywordAlter_Assembly,
		KeywordDrop_Assembly,
		KeywordAlter_Authorization_Database,
		KeywordCreate_Certificate,
		KeywordAlter_Certificate,
		KeywordDrop_Certificate,
		KeywordCreate_Contract,
		KeywordDrop_Contract,
		KeywordGrant_Database,
		KeywordDeny_Database,
		KeywordRevoke_Database,
		KeywordCreate_Event_Notification,
		KeywordDrop_Event_Notification,
		KeywordCreate_Function,
		KeywordAlter_Function,
		KeywordDrop_Function,
		KeywordCreate_Index,
		KeywordAlter_Index,
		KeywordDrop_Index,
		KeywordCreate_Message_Type,
		KeywordAlter_Message_Type,
		KeywordDrop_Message_Type,
		KeywordCreate_Partition_Function,
		KeywordAlter_Partition_Function,
		KeywordDrop_Partition_Function,
		KeywordCreate_Partition_Scheme,
		KeywordAlter_Partition_Scheme,
		KeywordDrop_Partition_Scheme,
		KeywordCreate_Procedure,
		KeywordAlter_Procedure,
		KeywordDrop_Procedure,
		KeywordCreate_Queue,
		KeywordAlter_Queue,
		KeywordDrop_Queue,
		KeywordCreate_Remote_Service_Binding,
		KeywordAlter_Remote_Service_Binding,
		KeywordDrop_Remote_Service_Binding,
		KeywordCreate_Role,
		KeywordAlter_Role,
		KeywordDrop_Role,
		KeywordCreate_Route,
		KeywordAlter_Route,
		KeywordDrop_Route,
		KeywordCreate_Schema,
		KeywordAlter_Schema,
		KeywordDrop_Schema,
		KeywordCreate_Service,
		KeywordAlter_Service,
		KeywordDrop_Service,
		KeywordCreate_Statistics,
		KeywordDrop_Statistics,
		KeywordUpdate_Statistics,
		KeywordCreate_Synonym,
		KeywordDrop_Synonym,
		KeywordCreate_Table,
		KeywordAlter_Table,
		KeywordDrop_Table,
		KeywordCreate_Trigger,
		KeywordAlter_Trigger,
		KeywordDrop_Trigger,
		KeywordCreate_Type,
		KeywordDrop_Type,
		KeywordCreate_User,
		KeywordAlter_User,
		KeywordDrop_User,
		KeywordCreate_View,
		KeywordAlter_View,
		KeywordDrop_View,
		KeywordCreate_Xml_Schema_Collection,
		KeywordAlter_Xml_Schema_Collection,
		KeywordDrop_Xml_Schema_Collection,

		// DDL Statements with Server Scope
		KeywordAlter_Authorization_Server,
		KeywordCreate_Database,
		KeywordAlter_Database,
		KeywordDrop_Database,
		KeywordCreate_Endpoint,
		KeywordDrop_Endpoint,
		KeywordCreate_Login,
		KeywordAlter_Login,
		KeywordDrop_Login,
		KeywordGrant_Server,
		KeywordDeny_Server,
		KeywordRevoke_Server,

		KeywordColumn,
		KeywordMaxDop,
		KeywordOnline,
		KeywordMove,

		//
	}
}